import React from 'react';
import { useTheme } from '@/hooks/useTheme';

export function withTheme<P extends object>(
  Component: React.ComponentType<P & { theme: ReturnType<typeof useTheme> }>
) {
  return (props: P) => {
    const theme = useTheme();
    return <Component {...props} theme={theme} />;
  };
}